/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package yinshi.fsm;

import java.util.ArrayList;

/**
 *
 * @author yinshi
 */
public class State {

    public static final int EXIT_STATE_ID = -1;
    public static final int ENTRY_STATE_ID = 0;
    private final ArrayList<StateCond> stateConds = new ArrayList<StateCond>();
    private final Group group;
    public final int id;
    private boolean compiled = false;

    State(Group group, int id) {
        this.group = group;
        this.id = id;
    }

    public void newCond(Condition cond, int goto_id) {
        stateConds.add(new StateCond(cond, goto_id));
    }

    public Group getGroup() {
        return group;
    }

    private static class StateCond {

        final Condition cond;
        final int goto_id;

        StateCond(Condition cond, int goto_id) {
            this.cond = cond;
            this.goto_id = goto_id;
        }
    }
}